<?php
//------------------------------------------------------------------------------
// File               : V_DownloadDriverList
// Modification       :
//------------------------------------------------------------------------------
// Date(yyyy.mm.dd)   Developer                       Action
//------------------------------------------------------------------------------
// 2007.03.15         Oanhhtk                         Created
//------------------------------------------------------------------------------

function V_DownloadDriverList(&$arrayData){
	
	global $LANG;
    $ulr = "?".MODUL."=downloaddriver&".ACTION."=";
	global $db;
	include_once(DIR_MODEL."md_cat_san_pham.class.php");
	$objCatSanpham = new MD_CatSanpham($db);
	$arrayDataCat = array();
	$arrayDataCat = $objCatSanpham->getByWhere("*","","id desc");
	
?>
<table width="100%" cellpadding="5"  cellspacing="0" border="0" align="center">
<?
	$count=0;
	$i=0;
	foreach($arrayDataCat as $rowCat){
				
		include_once(DIR_MODEL."md_cat_san_pham.class.php");
		$objDownload = new MD_DownloadDriver($db);
		$arrayDownload = array();
		$arrayDownload = $objDownload->getByWhere("*","id_danh_muc =".$rowCat['id']."",""); 
		if(!empty($arrayDownload)){
		if($count==0){
?>
	<tr valign="top">	
<?
		}// end if($count==0)
?>
		<td  width="50%" align="center">
			<table width="90%" cellpadding="0"  cellspacing="0" border="0" align="center" >
				<tr>
					<td class="title_download">
						<?=$rowCat['ten_loai_sp']?>
					</td>
				</tr>
				<tr>
					<td style="padding-top:5px; "></td>
				</tr>
				<?
					foreach($arrayData as $row){
						$id_danh_muc = $row['id_danh_muc'];
						if($id_danh_muc == $rowCat['id']){
				?>
				<tr>
					<td style="font-family:tahoma; font-size:12px; padding-left:10px; text-align:left; ">
						<a href="<?=DIR_DOWNLOAD_FILE.$row['ten_file']?>" class="title_content">
							<?=$row['ten_danh_muc']?>
						</a>
					</td>
				</tr>
				
				<?	
						}// end if($id_danh_muc == $rowCat['id'])
					}// end foreach($arrayData as $row)
				?>
			</table>
		</td>
<?
		$count+=1;
		if($count >1){
			$count =0;
?>
	</tr>
<?
	}
		}// end if($count >1)
	}// end foreach($arrayDataCat as $rowCat)
?>
</table>

<?
}// ket thuc ham
?>